package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import negocio.Sala;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JScrollPane;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.border.TitledBorder;

public class AulaDescripcion extends JFrame {

	private JPanel contentPane;
	private JTextField txtAs;
	private JTable table;
	private JScrollPane scrollPane;
	private JTable table_1;
	private JScrollPane scrollPane_1;
	private JButton btnSalir;
	private JPanel panel;
	private JPanel panel_1;

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AulaDescripcion frame = new AulaDescripcion(null);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AulaDescripcion(Aulas padre) {
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e){
				padre.nullauladescripcion();
			}
		});
		setTitle("Aula 0");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 490, 650);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblCapacidadMaxima = new JLabel("Capacidad Maxima:");
		lblCapacidadMaxima.setBounds(10, 18, 100, 14);
		contentPane.add(lblCapacidadMaxima);
		
		txtAs = new JTextField();
		txtAs.setHorizontalAlignment(SwingConstants.RIGHT);
		txtAs.setEditable(false);
		txtAs.setText("0");
		txtAs.setBounds(120, 15, 35, 20);
		contentPane.add(txtAs);
		txtAs.setColumns(10);
		
		panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "Descripcion", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(10, 43, 452, 115);
		contentPane.add(panel);
		panel.setLayout(null);
		
		scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 16, 432, 92);
		panel.add(scrollPane);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				""
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		table.getColumnModel().getColumn(0).setResizable(false);
		
		panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "Ocupacion por Cursadas", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_1.setBounds(4, 175, 464, 392);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(10, 132, 444, 249);
		panel_1.add(scrollPane_1);
		
		table_1 = new JTable();
		scrollPane_1.setViewportView(table_1);
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"HS", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado", "Domingo"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false, false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		table_1.getColumnModel().getColumn(0).setPreferredWidth(43);
		table_1.getColumnModel().getColumn(1).setResizable(false);
		table_1.getColumnModel().getColumn(2).setResizable(false);
		table_1.getColumnModel().getColumn(3).setResizable(false);
		table_1.getColumnModel().getColumn(4).setResizable(false);
		table_1.getColumnModel().getColumn(5).setResizable(false);
		table_1.getColumnModel().getColumn(6).setResizable(false);
		table_1.getColumnModel().getColumn(7).setResizable(false);
		
		btnSalir = new JButton("Salir");
		btnSalir.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				padre.nullauladescripcion();
				dispose();
			}
		});
		btnSalir.setBounds(373, 578, 89, 23);
		contentPane.add(btnSalir);
	}
}